package com.example.module_main.main

import androidx.lifecycle.MutableLiveData
import com.example.lib_common.base.BaseViewModel
import com.example.lib_net.model.api.UpdateModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

/**
 * @author yaotianxue
 * @description
 * @date 2025/1/17
 */
@HiltViewModel
class MainViewModel @Inject constructor(private val mRepository:MainRepository) :BaseViewModel(){

    val mUpdateLiveData by lazy{
        MutableLiveData<UpdateModel>()
    }

    /**
     * 判断版本是否需要更新
     */
    fun appLevelCheck(){
        execute(
            action = mRepository.appLevelCheck(),
            onFinished = {
                mUpdateLiveData.value = it.data
            }
        )
    }
}